#pragma once

#include <Windows.h>
#include "DirectX.h"
#include "dxinput.h"
#include "Sprite.h"
//#include "ResourceManager.h"
#include "Collision.h"

class CGame
{
public:
	CGame(void);
	CGame(HINSTANCE hInstance, LPCSTR GameName, LPSTR lpCmdLine, int nShowCmd, int FPS, int ScreenWidth, int ScreenHeight);
	~CGame(void);

	int InitWindow();
	int GameInit();

	void GameLoop();
	void GameEnd();
	virtual void GameUpdate();
	void GameRender();

	void ProcessKeyboard();

	virtual void LoadResource() = 0;
	virtual void RenderFrame() = 0;

	


protected:
	static LRESULT CALLBACK WinProc(HWND hWnd,UINT msg,WPARAM wParam, LPARAM lParam);

	HINSTANCE _hInstance;
	HWND _hWnd;
	LPSTR _lpCmdLine;
	int _nShowCmd;

	//LPDIRECT3DSURFACE9 _backbuffer,_background;
	Sprite* _sprite;
	LPCSTR _gameName;

	//CResourceManager *_rm;

	//test

	int _FPS;
	int _screenWidth;
	int _screenHeight;

	 

	DirectX *_directX;
	DxInput *p_input;
	DWORD _DeltaTime;		// Time between the last frame and current frame
	//DXinput *_dInput;

	//Collision _coll;

};

